In microcoding, as in normal coding, in order to save microcode space, commonly-used microsubroutines are "callable". When a microsubroutine is called, the microcode program will jump to the appropriate microcode which begins the microsubroutine. At the end of the microsubroutine, a "return" causes the microcode program to return to the address in the main microcode program from which it jumped to the microsubroutine. Of course, there can be nesting so that the program will jump from one microsubroutine into another microsubroutine.
To keep track of the address from which the microprogram jumped (either from the main microprogram or microsubroutine), a microstack is used. When a jump to a microsubroutine is called, the address in the program which called for the jump is written into the microstack. The pointer in the microstack points to this address since it was the last one written into the microstack. When the microsubroutine signals for a return to the main program, the address is popped off the microstack and the program is returned to the address which called for the jump originally. The pointer is then updated to point to the address which is now the last one which was written into the microstack.
In some modern computers, pipelining of instructions is used in order to speed up the machine. In nonpipelined machines, a piece of data will completely pass through a series of operations before the next piece of data begins passing through the series. In a pipeline machine, by contrast, the next piece of data follows closely behind the first piece of data in entering the series of operations. In this manner, the second operation in the series will be operating on the first piece of data while the first operation in the series will be operating on the second piece of data to enter the series.
Although pipelining increases the speed of the machine, a problem occurs due to traps. A microtrap is an event which has not occurred properly in the machine, as detected by a parity bit, for example. When a microtrap occurs, the machine must take care of this problem. To increase the speed of the machine, a pipelined program continues to process instructions even though an instruction which causes a microtrap was initiated some time ago. When the computer recognizes that a trap has occurred a trap handler address is issued to cause the computer to go to some part of a program which will handle the trap. Because the machine has blindly continued processing pipelined instructions after the instruction which would cause the trap occurrence, the computer may not be in a proper state at the time of the issuance of the trap handler address. Accordingly, part of the restoration of the state of the computer is the reconstruction of the microstack to the state it should have been at the time of the issuance of the trap handler address or at the time of the trap occurrence, so that the reconstruction of the stack is invisible to the microcode.
In the prior art, instructions which were to be inputted to the stack were siloed before the stack. Bypasses from the silo to a multiplexer which was then connected to the stack provided for reconstructability of the microstack. The disadvantage of the prior art arrangement is the relatively large number of gates which need to be used.
An objective of the present invention is to provide an arrangement and a method for reconstructing a microstack so that the reconstruction is invisible to the microcode, while reducing the number of gates needed for performing this reconstruction.